package mypackage.file;

import java.io.File;

public class DirTest {

    public static void main(String[] args) {

        String parentDir = "tempFile";
        String childDir = "aaa";
        String targetDir = parentDir+"\\"+childDir;
        File file = new File(targetDir);
        boolean exists = file.exists();
        
        if(!exists){
            boolean mkdir = file.mkdir();
            System.out.println("mkdir:"+mkdir);
        }

        boolean directory = file.isDirectory();
        System.out.println(exists);
        System.out.println(directory);

        System.out.println(file.getName());
        System.out.println(file.getAbsolutePath());

        System.out.println("---------");
        test1();
        System.out.println("--------");
        test2();
    }
    
    public static void test1(){
        File file = new File("/usr/tmp/package/6.1.7");
        System.out.println(file.getAbsolutePath());
        System.out.println(file.getPath());
    }
    
    public static void test2(){
        String str = "Jumi_vxiaomi_10_v5.4.2_542.apk";
        String result = str.substring(0,str.indexOf(".apk"));
        System.out.println(result);
    }
}
